import React, { memo, useEffect } from 'react'
import * as echarts from 'echarts';

const Echarts2 = memo( () => {
  useEffect(() => {
    var chartDom = document.getElementById('main2');
var myChart = echarts.init(chartDom);
var option1;

option1 = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [820, 932, 901, 934, 1290, 1330, 1320],
      type: 'line',
      smooth: true
    }
  ]
};

option1 && myChart.setOption(option1);

  })
  return (
    <div>
      <div id="main2" style={{ width: '100%', height: '80vh' }}></div>
    </div>
  )
})

export default Echarts2
